package com.ytjj.qmyx.supplychain.common.enums;

import lombok.Getter;

/**
 * @Description 快递中文 -> 编码
 * @ClassName ExpressEnum
 * 
 * 
 * @Version 1.0
 **/

@Getter
public enum ExpressEnum {
    HAPPY_LINK("开心快递", "happylink"),
    YZ_GUONEI("邮政国内", "yzguonei"),
    JIE_bANG("捷邦物流", "jieborne"),
    YUN_DA_FAST("韵达快运", "yundakuaiyun"),
    ZHONG_TONG("中通快递", "zhongtong"),
    SUN_FENG_COMPLEX("顺丰-繁体", "shunfenghk"),
    MO_GU_JIE("蘑菇街", "mogujieorder"),
    GUO_MEI("国美", "gomeorder"),
    AMAZON("亚马逊中国订单","amazoncnorder"),
    DE_BANG_FAST("德邦快运", "debangwuliu"),
    SHENG_TONG_FAST("申通快运", "stoe56"),
    BAI_SHI_FAST("百世快运", "baishiwuliu"),
    YUN_DA("韵达快递", "yunda"),
    BAI_SHI("百世快递", "huitongkuaidi"),
    YUAN_TONG_FAST("圆通速递", "yuantong"),
    ZAI_JI_SONG("宅急送", "zhaijisong"),
    SUN_FENG_FAST("顺丰速运", "shunfeng"),
    SHENG_TONG("申通快递", "shentong"),
    JING_DONG("京东物流", "jd"),
    KUAI_DI("快递", "weiluru"),
    EMS("EMS", "ems")
    ;

    /**
     * 快递中文名
     */
    private String expressName;

    /**
     * 快递编码
     */
    private String expressCode;

    ExpressEnum(String expressName, String expressCode) {
        this.expressName = expressName;
        this.expressCode = expressCode;
    }

    /**
     * 获取快递编码
     *
     * @param expressName
     * @return
     */
    public static String getExpressCode(String expressName) {
        ExpressEnum[] values = ExpressEnum.values();
        for (ExpressEnum expressEnum : values) {
            if(expressEnum.getExpressName().equals(expressName)) {
                return expressEnum.getExpressCode();
            }
        }
        return null;
    }



    public static String getExpressName(String expressCode){
        for (ExpressEnum value : ExpressEnum.values()) {
            if(value.getExpressCode().equals(expressCode)){
                return value.getExpressName();
            }
        }
        return null;
    }
}

